﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RolesTree.aspx.cs" Inherits="Besture.UI.Admin.Sys.RolesTree" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="/Admin/PlugIn/ZTree/css/zTreeStyle/zTreeStyle.css" type="text/css" />
    <script type="text/javascript" src="/Admin/PlugIn/ZTree/js/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="/Admin/PlugIn/ZTree/js/jquery.ztree.core-3.5.js"></script>
    <script type="text/javascript" src="/Admin/PlugIn/ZTree/js/jquery.ztree.excheck-3.5.js"></script>
    <script type="text/javascript">
		<!--
        var setting = {
            check: {
				enable: true
			},
			data: {
				simpleData: {
					enable: true
				}
			}
		};
        

        var zNodes = <%=_json %>;

        $(document).ready(function () {
            $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        });
		//-->
        
    	var api = frameElement.api, W = api.opener;

    	api.button({
    	    id: 'valueOk',
    	    name: '确定',
    	    callback: ok
    	});

    	function ok() {
    	   var zTree = $.fn.zTree.getZTreeObj("treeDemo");
 
            var nodes = zTree.getCheckedNodes(true);
 
            var purview = "";
 
 
 
            for (var i = 0; i < nodes.length; i++) {
 
            if(!nodes[i].getCheckStatus().half)
 
                purview +=  nodes[i].id+",";
 
            }          
    	    W.jQuery(".userPermissionsClass").val(purview);
    	}
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="content_wrap">
        <div class="zTreeDemoBackground left">
            <ul id="treeDemo" class="ztree">
            </ul>
        </div>
    </div>
    </form>
</body>
</html>
